﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SampleApp
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		EditorApp m_app;

		public MainWindow()
        {
            InitializeComponent();

			m_app = new EditorApp(this);
            m_app.Init();
			
            MainWindowTabControl.DataContext = m_app.DocumentManager.TabViewContext;
            MainWindowMenuBar.DataContext = m_app.MainMenu;
        }

		private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			if (!m_app.DocumentManager.CloseAllManagedDocuments())
			{
				e.Cancel = true;
			}
		}
	}
}
